\ ActiveX Words
\ Tom Dixon
\ 9/5/2008

\ *! ActiveX
\ *T ActiveX Control Utilities

\ *P These words are used for hosting ActiveX controls in child
\ ** windows. It takes care of most of the container interfacing
\ ** so that the ActiveX control can be treated as a child window.

also FCOM

[-sin
: AXCreate ( str len hwnd -- )
\ *G Creates an ActiveX control and attaches it to a window handle.
   -rot >unicode drop 0 0 2swap fAtlAxCreateControl
   err_AXcreate ?throw  ;
\   abort" Unable to create ActiveX Control!" ;

: AXGetIUnknown ( addr hwnd -- )
\ *G Stores the IUnknown of an ActiveX object in the hwnd window to addr.
   fAtlAxGetControl err_IUnknown ?throw  ;
\  abort" Unable to get IUnknown interface!" ;

: AXQuery ( addr IID hwnd -- )
\ *G Queries a given interface to an ActiveX control (in a windows handle)
\ ** and stores the interface in addr.
   0 >r rp@ swap AXGetIUnknown
   rp@ COM IUnknown IQueryInterface
   rp@ COM IUnknown IReleaseRef drop r> drop
   err_noIF ?throw
\   abort" Unable to get Interface!"
;
sin]

previous